package com.dmcb.trade.business.crawlers.article;

import com.dmcb.trade.business.constants.CrawlConstant;
import com.dmcb.trade.business.entities.Article;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.nodes.Document;
import org.springframework.stereotype.Service;

/**
 * 腾讯新闻
 *
 * Created by Administrator on 2016/4/28.
 */
@Service
public class TengXunParser extends BaseParser {

    /**
     * 网站URL网址
     *
     * @return 链接
     */
    @Override
    protected String url() {
        return CrawlConstant.TENGXUN_URL;
    }

    /**
     * 获取标题选择器
     *
     * @return 标题选择器
     */
    @Override
    protected String titleSelect() {
        return "div.art-header>h1,title.next-head,span._2YwoMnszaGampnHrvJuamM,h2.title,h2#activity-name,div.hd>h1,h1,div.details-info>h2";
    }
    /**
     * 获取日期选择器
     *
     * @return 发布日期选择器
     */
    @Override
    protected String dateSelect() {
        return "span.a_time,span.article-time,div.new-ong-date,div.left-stick-wp";
    }

    /**
     * 获取正文内容选择器
     *
     * @return 正文内容选择器
     */
    @Override
    protected String bodySelect() {
        return "div#Cnt-Main-Article-QQ,div.g-wrapper,div.content-article";
    }

    /**
     * 获取封面选择器
     *
     * @return 封面选择器
     */
    @Override
    protected String coverSelect() {
        return "div#Cnt-Main-Article-QQ>p img[src]，div#Cnt-Main-Article-QQ>p>div img[src],div.content-article img[src]";
    }

    @Override
    protected String authorNameSelect() {
        return "p.tit-tx,a.author>div";
    }

    @Override
    protected String platform() {
        return "腾讯";
    }
}
